package com.knight.hadoop.day12.zuoye;

import org.apache.hadoop.io.WritableComparable;
import org.apache.hadoop.io.WritableComparator;

/**
 * 相同的session的分到一个group
 * @author 
 *
 */
public class GroupLogSessionComparator extends WritableComparator{
	
	public GroupLogSessionComparator() {
		super(LogBean2.class, true);
	}
	
	@Override
	public int compare(WritableComparable a, WritableComparable b) {
		LogBean2 aBean = (LogBean2) a;
		LogBean2 bBean = (LogBean2) b;
		if(aBean.getSessionId().equals(bBean.getSessionId())){
			return 0;
		}
		return 1;
	}
}
